package cn.boat.router.broker.partition.strategy;


import cn.boat.router.exception.BoatMQException;

import java.util.List;

public abstract class AbstractPartitionSelector implements PartitionSelector{
    @Override
    public List<Integer> getPartitionDistribution(List<Integer> totalList, Integer num) throws BoatMQException {
        if (totalList == null) {
            throw new BoatMQException("There is no available partitions to select.");
        }else{
            return getPartitionDistribution0(totalList, num);
        }
    }
    public abstract List<Integer> getPartitionDistribution0(List<Integer> totalList, Integer num);
}
